package com.letv.core.parser;


import org.json.JSONObject;

import com.letv.core.bean.PlayTraceBoolean;


public class PlayTraceBooleanParser extends LetvBaseParser<PlayTraceBoolean, JSONObject>{

	public PlayTraceBooleanParser() {
        super(0);
    }

    @Override
	public PlayTraceBoolean parse(JSONObject data) throws Exception {
		
		if(data != null ){
			int result = getInt(data, "result");
			
			PlayTraceBoolean playTraceBoolean = new PlayTraceBoolean() ;
			
			playTraceBoolean.setSucceed(result == 1);
			
			return playTraceBoolean ;
		}
		
		return null;
	}

	@Override
	protected boolean canParse(String data) {
		return true;
	}

	@Override
	protected JSONObject getData(String data) throws Exception {
		return new JSONObject(data);
	}
}
